package com.example.administrator.myproject.Adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/12/14.
 */

public class ViPagerAdapter extends FragmentStatePagerAdapter {


    private List<Fragment> fragmentList;
    int COUNT = 11;
    private String tabTitles[] = new String[]{"全部分类", "演唱会", "音乐会", "话剧歌剧", "舞蹈芭蕾", "曲苑杂坛", "体育比赛", "休闲度假", "周边商品", "儿童亲子", "动漫"};
    private Context context;

    public ViPagerAdapter(FragmentManager fm, Context context, List<Fragment> fragment) {
        super(fm);
        this.context = context;
        this.fragmentList = fragment;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return COUNT;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabTitles[position];
    }
}
